# schemas/sys_field_mapping.py
from pydantic import BaseModel
from typing import Optional


class SysFieldMappingBase(BaseModel):
    api_id: Optional[str] = None
    table_id: Optional[str] = None
    field_name: Optional[str] = None
    field_title: Optional[str] = None
    field_description: Optional[str] = None
    mapping_field_name: Optional[str] = None

    deletion_mark: Optional[int] = 0
    deletion_reason: Optional[str] = None
    deletion_date: Optional[str] = None
    deletion_by: Optional[str] = None
    creator_by: Optional[str] = None
    last_updated_by: Optional[str] = None


class SysFieldMappingCreate(SysFieldMappingBase):
    pass


class SysFieldMappingUpdate(SysFieldMappingBase):
    pass


class SysFieldMapping(SysFieldMappingBase):
    id: str
    create_date: str
    last_updated_date: Optional[str] = None

    class Config:
        from_attributes = True
